package cn.entergx.smallmengplan.network
import cn.entergx.smallmengplan.LoveEvent
import cn.entergx.yztx.bean.page.SpringPage
import retrofit2.Callback
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory


object Repo {

    private val ipService: IpService = Retrofit.Builder()
        .addConverterFactory(GsonConverterFactory.create())
        .baseUrl("http://118.178.178.211:8081/").build().create(IpService::class.java)
    fun get(page:Int,size:Int,callback: Callback<SpringPage<LoveEvent>>){
        ipService.get(page, size).enqueue(callback)
    }
    fun delete(id:Int,callback: Callback<Int>){
        ipService.delete(id).enqueue(callback)
    }
    fun save(content:String,note:String,completed:Int,callback: Callback<Int>){
        ipService.save(content,note,completed).enqueue(callback)
    }
    fun update(id:Int,content:String,note:String,completed:Int,callback: Callback<Int>){
        ipService.update(id,content,note,completed).enqueue(callback)
    }
}